package com.zjz.common.demo.oom.polymorphism;

import com.zjz.common.demo.oom.inheritance.Bicycle;

/**
 * @author Zhang Jinzhong
 * @version V1.0
 * @since 2018-10-08 15:07
 */
public class RoadBike extends Bicycle {

    // In millimeters (mm)
    /**
     * 轮胎宽度
     */
    private int tireWidth;

    public RoadBike(int startCadence, int startSpeed, int startGear, int newTireWidth) {
        super(startCadence, startSpeed, startGear);
        this.setTireWidth(newTireWidth);
    }

    public int getTireWidth() {
        return this.tireWidth;
    }

    public void setTireWidth(int newTireWidth) {
        this.tireWidth = newTireWidth;
    }

    @Override
    public void printDescription() {
        super.printDescription();
        System.out.println("The RoadBike" + " has " + getTireWidth() + " MM tires.");
    }
}
